package com.platform.enums;

/**
 * Description: 数据库
 *
 * @author zyk
 */
public enum DBTypeName {
    MySql5("MySQL5.x.x","MySql"),
    MySql8("MySQL8.x.x","MySql"),
    GBase("GBase", "GBase"),
    Oracle("Oracle","Oracle"),
    SqlServer("SQL Server","SqlServer"),
    PostgreSQL("PostgreSQL","PostgreSQL"),
    ClickHouse("ClickHouse","ClickHouse"),
    Greenplum("Greenplum","Greenplum");

    private String name;

    private String oldName;

    public static DBTypeName value(String type){
        for(DBTypeName dbType : DBTypeName.values()){
            if(dbType.getName().equalsIgnoreCase(type)
                    || dbType.getOldName().equalsIgnoreCase(type)){
                return dbType;
            }
        }
        return null;
    }

    DBTypeName(String name,String oldName) {
        this.name = name;
        this.oldName = oldName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOldName() {
        return oldName;
    }

    public void setOldName(String oldName) {
        this.oldName = oldName;
    }}
